package com.hccl.sluentities;

import entities.Reply;
import entities.SLUResult;
import gate.Annotation;

import javax.xml.bind.annotation.*;
import java.util.*;

/**
 * Created by thinkit on 2017/4/6.
 */

@XmlRootElement(name="Result")
public class ResultsEntity {

    private String domain = "menu";
    @XmlElement
    private DialogEntity dialog = new DialogEntity();

    @XmlElement
    private FuncEntity func = new FuncEntity();

    public void setInput(String input) {
        dialog.setInput(input);
    }


    public void setUserid(String userid) {
        dialog.setUserid(userid);
    }

    public void setKeypad(boolean keypad) {
        dialog.setKeypad(keypad);
    }


    public void setReply(List<Reply> replys) {
        dialog.setReplys(replys);
    }
    public void setAction(String action) {
        dialog.setAction(action);
    }


    public void setFunction(String function) {
        dialog.setFunction(function);
    }


    public void setParams(Map<String, String> params) {
        dialog.setParams(params);
    }


    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getDomain() {
        return domain;
    }

    public DialogEntity getDialog() {
        return dialog;
    }

    public FuncEntity getFunc() {
        return func;
    }

    public void setFunc(FuncEntity func) {
        this.func = func;
    }

    public void setDebug(ArrayList<SLUResult> debug){
        func.setDebug(debug);
    }
    public void setGazetteer(Set<Annotation> gazetteer){
        func.setGazetteer(gazetteer);
    }


}



class DialogEntity {

    private String userid;

    public boolean keypad = false;

    public List<Reply> getReplys() {
        return replys;
    }

    public void setReplys(List<Reply> replys) {
        this.replys = replys;
    }

    private List<Reply> replys;
    private String action;
    private String input;

    private QueryEntity query = new QueryEntity();

    public boolean isKeypad() {
        return keypad;
    }

    public void setKeypad(boolean keypad) {
        this.keypad = keypad;
    }



    public String getInput() {
        return input;
    }

    public void setInput(String input) {
        this.input = input;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }


    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }


    public void setFunction(String function) {
        query.setFunction(function);
    }


    public void setParams(Map<String, String> params) {
        query.setParams(params);
    }

    public QueryEntity getQuery() {
        return query;
    }

    public void setQuery(QueryEntity query) {
        this.query = query;
    }
}

class QueryEntity {
    private Map<String, String> params;
    private String function;

    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    public String getFunction() {
        return function;
    }

    public void setFunction(String function) {
        this.function = function;
    }
}

@XmlAccessorType(XmlAccessType.FIELD)
class FuncEntity {
    private ArrayList<SLUResult> debug;

    @XmlTransient
    private Set<Annotation> gazetteer;

    public Set<Annotation> getGazetteer() {
        return gazetteer;
    }

    public void setGazetteer(Set<Annotation> gazetteer) {
        this.gazetteer = gazetteer;
    }

    public ArrayList<SLUResult> getDebug() {
        return debug;
    }

    public void setDebug(ArrayList<SLUResult> debug) {
        this.debug = debug;
    }
}


